package com.libgdxbar.pvzlikegame.entities;

import com.badlogic.gdx.math.Vector2;
import org.libgdxbar.projects.interfaces.Locationable;

// 拥有位置信息的实体
public class LocationEntity extends BaseEntity implements Locationable {
	final Vector2 position;

	public LocationEntity() {
		this(0, 0);
	}

	public LocationEntity(Vector2 position) {
		this(position.x, position.y);
	}

	public LocationEntity(float x, float y) {
		position = new Vector2(x, y);
	}

	@Override
	public void run(float delta) {

	}

	public Vector2 getPosition() {
		return position;
	}

	public void setPosition(Vector2 position) {
		position.set(position);
	}

	public void setPosition(float x, float y) {
		position.set(x, y);
	}

	@Override
	public float getX() {
		return position.x;
	}

	@Override
	public void setX(float x) {
		position.x = x;
	}

	@Override
	public float getY() {
		return position.y;
	}

	@Override
	public void setY(float y) {
		position.y = y;
	}
}
